Skip to content

Conversation

@naushir
Copy link
Contributor

@naushir naushir commented Apr 3, 2025

Calling this function without holding the mmap_read_lock causes the kernel to throw an error message, spamming the dmesg logs when running the Hailo hardware.

Fix it by adding the approprite lock/unlock functions around find_vdma().

Calling this function without holding the mmap_read_lock causes the
kernel to throw an error message, spamming the dmesg logs when running
the Hailo hardware.

Fix it by adding the approprite lock/unlock functions around find_vdma().

Signed-off-by: Naushir Patuck <[email protected]>
@naushir
Copy link
Contributor Author

naushir commented Apr 3, 2025

The formatting for this patch is all messed and will fail the check, but matches the original source code from Hailo.

@naushir naushir marked this pull request as draft April 3, 2025 10:00
@naushir
Copy link
Contributor Author

naushir commented Apr 3, 2025

Let's hold off from merging this until Hailo have a change to review - I've pinged them already.

@naushir naushir marked this pull request as ready for review April 3, 2025 13:23
@naushir naushir merged commit bc0a232 into raspberrypi:rpi-6.12.y Apr 3, 2025
16 of 26 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Apr 7, 2025
kernel: Added waveshare 7.0inch h dsi screen support
See: raspberrypi/linux#6764

kernel: drivers: pci: hailo: Fix kernel warning when calling find_vdma()
See: raspberrypi/linux#6765

kernel: configs: Make the RTL8152 driver a module
See: raspberrypi/linux#6768
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Apr 7, 2025
kernel: Added waveshare 7.0inch h dsi screen support
See: raspberrypi/linux#6764

kernel: drivers: pci: hailo: Fix kernel warning when calling find_vdma()
See: raspberrypi/linux#6765

kernel: configs: Make the RTL8152 driver a module
See: raspberrypi/linux#6768
@naushir naushir deleted the hailo_fix branch May 13, 2025 08:59
@tsailerddln
Copy link

Unfortunately, while this fix silences the dmesg spamming, but it causes the hailo driver to hang after a minute or ten.

[HailoRT] [error] CHECK failed - Waiting for async job to finish has failed with timeout (1000ms)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_TIMEOUT(4)

And the kernel:
[ 1209.578099] Call trace:
[ 1209.578101] __switch_to+0xf0/0x160
[ 1209.578111] __schedule+0x32c/0xb60
[ 1209.578115] schedule+0x3c/0x148
[ 1209.578119] schedule_preempt_disabled+0x2c/0x50
[ 1209.578124] rwsem_down_read_slowpath+0x1e0/0x510
[ 1209.578127] down_read+0xb0/0xc0
[ 1209.578130] hailo_vdma_buffer_map+0x3c8/0x6b0 [hailo_pci]
[ 1209.578141] hailo_vdma_buffer_map_ioctl+0xcc/0x348 [hailo_pci]
[ 1209.578146] hailo_vdma_ioctl+0x254/0x2a8 [hailo_pci]
[ 1209.578151] hailo_pcie_fops_unlockedioctl+0x16c/0x7e8 [hailo_pci]
[ 1209.578157] __arm64_sys_ioctl+0xb0/0x100
[ 1209.578162] invoke_syscall+0x50/0x120
[ 1209.578167] el0_svc_common.constprop.0+0x48/0xf8
[ 1209.578171] do_el0_svc+0x28/0x40
[ 1209.578175] el0_svc+0x30/0xd0
[ 1209.578179] el0t_64_sync_handler+0x13c/0x158
[ 1209.578182] el0t_64_sync+0x190/0x198

@naushir
Copy link
Contributor Author

naushir commented May 23, 2025

@tsailerddln what are you running to cause this error? I'll try to reproduce this on my end.

EDIT: It might be useful to try out the change in #6868 to see if it helps improve your stability.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request May 24, 2025
kernel: drivers: pci: hailo: Fix kernel warning when calling find_vdma()
See: raspberrypi/linux#6765
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request May 24, 2025
kernel: drivers: pci: hailo: Fix kernel warning when calling find_vdma()
See: raspberrypi/linux#6765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants